/*
 * =====================================================================================
 *
 *       Filename:  set_device.c
 *
 *    Description:  set device
 *
 *        Version:  1.0
 *        Created:  2012年11月29日 10时27分10秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdlib.h>
#include <stdio.h>
#include <pcap.h>

int main(int argc,char *argv[])
{
	char *dev,errbuf[PCAP_ERRBUF_SIZE];

	dev=pcap_lookupdev(errbuf);
	if(dev==NULL)
	{
		fprintf(stderr,"Couldn't find default device: %s\n",errbuf);
		return 2;
	}
	printf("Device is %s \n",dev);
	return 0;
}
